<%
def cp(path)
  "active" if current_page?(path)
end
%>
<h1 class="section-header">
  Specific to React on Rails Pro
</h1>
<ul class="menu">
  <li>
    <%= link_to "Streaming async React components", stream_async_components_path, class: cp(stream_async_components_path) %>
  </li>
  <li>
    <%= link_to "RSC Posts Page Over HTTP", rsc_posts_page_over_http_path, class: cp(rsc_posts_page_over_http_path) %>
  </li>
  <li>
    <%= link_to "RSC Posts Page Over Redis", rsc_posts_page_over_redis_path, class: cp(rsc_posts_page_over_redis_path) %>
  </li>
  <li>
    <%= link_to "Async On Server Sync On Client", async_on_server_sync_on_client_path, class: cp(async_on_server_sync_on_client_path) %>
  </li>
  <li>
    <%= link_to "Async On Server Sync On Client Client Render", async_on_server_sync_on_client_client_render_path, class: cp(async_on_server_sync_on_client_client_render_path) %>
  </li>
  <li>
    <%= link_to "Server Router", server_router_path, class: cp(server_router_path) %>
  </li>
  <li>
    <%= link_to "Server Router Client Render", server_router_client_render_path, class: cp(server_router_client_render_path) %>
  </li>
  <li>
    <%= link_to "Posts Page", posts_page_path, class: cp(posts_page_path) %>
  </li>
  <li>
    <%= link_to "Caching: simple cached_react_component", server_side_redux_app_cached_path, class: cp(server_side_redux_app_cached_path) %>
  </li>
  <li>
    <%= link_to " Caching: Generator function returns object with renderedHtml", cached_react_helmet_path, class: cp(cached_react_helmet_path) %>
  </li>
  <li>
    <%= link_to "Loadable Component", loadable_component_path, class: cp(loadable_component_path) %>
  </li>
  <li>
    <%= link_to "Server Render With Timeout", server_render_with_timeout_path, class: cp(server_render_with_timeout_path) %>
  </li>
  <li>
    <%= link_to("Fragment Caching with Redux", cached_redux_component_path, class: cp(cached_redux_component_path)) %>
  </li>
  <li>
    <%= link_to("React 18 Apollo with GraphQL", apollo_graphql_path, class: cp(apollo_graphql_path)) %>
  </li>
  <li>
    <%= link_to("React 18 Apollo with Lazily Loaded GraphQL", lazy_apollo_graphql_path, class: cp(lazy_apollo_graphql_path)) %>
  </li>
  <li>
    <%= link_to("Console Logs in Async Server", console_logs_in_async_server_path, class: cp(console_logs_in_async_server_path)) %>
  </li>
  <li>
    <%= link_to("Async Render Function Returns a String", async_render_function_returns_string_path, class: cp(async_render_function_returns_string_path)) %>
  </li>
  <li>
    <%= link_to("Async Render Function Returns a Component", async_render_function_returns_component_path, class: cp(async_render_function_returns_component_path)) %>
  </li>
</ul>

<h2 class="text-red-700 text-2xl mt-5">
  Other examples
</h2>
<h3 class="italic mb-2 text-gray-600">
  matches react_on_rails/spec_dummy
</h3>
<ul class="menu">
  <li>
    <%= link_to "One Page with Many Examples at Once", root_path, class: cp(root_path) %>
  </li>
  <li>
    <%= link_to "Hello World Component Server Rendered Hooks", server_side_hello_world_hooks_path, class: cp(server_side_hello_world_hooks_path) %>
  </li>
  <li>
    <%= link_to "Hello World Component Client Rendered", client_side_hello_world_path, class: cp(client_side_hello_world_path) %>
  </li>
  <li>
    <%= link_to "Hello World Shared Redux Components Client Rendered",
                client_side_hello_world_shared_store_path, class: cp(client_side_hello_world_shared_store_path) %>
  </li>
  <li>
    <%= link_to "Hello World Shared Redux Components Client Rendered Controller",
                client_side_hello_world_shared_store_controller_path, class: cp(client_side_hello_world_shared_store_controller_path) %>
  </li>
  <li>
    <%= link_to "Hello World Shared Redux Components Client Rendered Defer",
                client_side_hello_world_shared_store_defer_path, class: cp(client_side_hello_world_shared_store_defer_path) %>
  </li>
  <li>
    <%= link_to "Hello World Shared Redux Components Server Rendered",
                server_side_hello_world_shared_store_path, class: cp(server_side_hello_world_shared_store_path) %>
  </li>
  <li>
    <%= link_to "Hello World Shared Redux Components Server Rendered Controller",
                server_side_hello_world_shared_store_controller_path, class: cp(server_side_hello_world_shared_store_controller_path) %>
  </li>
  <li>
    <%= link_to "Hello World Shared Redux Components Server Rendered Defer",
                server_side_hello_world_shared_store_defer_path, class: cp(server_side_hello_world_shared_store_defer_path) %>
  </li>
  <li>
    <%= link_to "Hello World Component Server Rendered", server_side_hello_world_path, class: cp(server_side_hello_world_path) %>
  </li>
  <li>
    <%= link_to "Hello World Component Server Rendered, with extra options", server_side_hello_world_with_options_path, class: cp(server_side_hello_world_with_options_path) %>
  </li>
  <li>
    <%= link_to "Hello World Component Server Rendered ES5", server_side_hello_world_es5_path, class: cp(server_side_hello_world_es5_path) %>
  </li>
  <li>
    <%= link_to "Redux App Server Rendered (Render-Function)", server_side_redux_app_path, class: cp(server_side_redux_app_path) %>
  </li>
  <li>
    <%= link_to "Redux App Server Rendered (Render-Function) With Fragment Caching", server_side_redux_app_cached_path, class: cp(server_side_redux_app_cached_path) %>
  </li>
  <li>
    <%= link_to "Client Logging and Throw Error Handling", client_side_log_throw_path, class: cp(client_side_log_throw_path) %>
  </li>
  <li>
    <%= link_to "Server Logging and Throw Error Handling", server_side_log_throw_path, class: cp(server_side_log_throw_path) %>
  </li>
  <li>
    <%= link_to "Server Logging and Throw Error Handling Plain JS", server_side_log_throw_plain_js_path, class: cp(server_side_log_throw_plain_js_path) %>
  </li>
  <li>
    <%= link_to "Server Logging and Throw Error Handling, raise on server error, redirects", server_side_log_throw_raise_invoker_path, class: cp(server_side_log_throw_raise_invoker_path) %>
  </li>
  <li>
    <%= link_to "render_js only example", render_js_path, class: cp(render_js_path) %>
  </li>
  <li>
    <%= link_to "XHR Refresh", xhr_refresh_path, class: cp(xhr_refresh_path) %>
  </li>
  <li>
    <%= link_to "Manually Rendered Component", client_side_manual_render_path, class: cp(client_side_manual_render_path) %>
  </li>
  <li>
    <%= link_to "React Router", react_router_path, class: cp(react_router_path) %>
  </li>
  <li>
    <%= link_to "Pure Component", pure_component_path, class: cp(pure_component_path) %>
  </li>
  <li>
    <%= link_to "CSS Modules Images Fonts Example", css_modules_images_fonts_example_path, class: cp(css_modules_images_fonts_example_path) %>
  </li>
  <li>
    <%= link_to "Turbolinks Cache Disabled Example", turbolinks_cache_disabled_path, class: cp(turbolinks_cache_disabled_path) %>
  </li>
  <li>
    <%= link_to "Render-Function returns object with renderedHtml", rendered_html_path, class: cp(rendered_html_path) %>
  </li>
  <li>
    <%= link_to "Render-Function returns object with renderedHtml as another object (react-helmet)", react_helmet_path, class: cp(react_helmet_path) %>
  </li>
  <li>
    <%= link_to "Improperly defined Render-Function (react-helmet)", react_helmet_broken_path, class: cp(react_helmet_broken_path) %>
  </li>
  <li>
    <%= link_to "Image Example", image_example_path, class: cp(image_example_path) %>
  </li>
  <li>
    <%= link_to "Incorrectly returning React Element (JSX) rather than React Function Component", context_function_return_jsx_path, class: cp(context_function_return_jsx_path) %>
  </li>
  <li>
    <%= link_to "Incorrectly wrapping a pure component in a function", pure_component_wrapped_in_function_path, class: cp(pure_component_wrapped_in_function_path) %>
  </li>
</ul>
<hr/>
